import java.util.*;
public class Example8_8 {
   public static void main(String args[]) {
      int i;
      Random random=new Random();
      int n = random.nextInt(10);
      int a[]=new int[n];
      String password = "";
      for(i=0;i<n;i++){
         a[i]=random.nextInt(26);
      }
      String sourceString = "今晚十点进攻";
      EncryptAndDecrypt person = new EncryptAndDecrypt();
      for(i=0;i<n;i++){
         password = password + a[i];
      }
      System.out.println("输入密码加密:"+password);
      String secret = person.encrypt(sourceString,password);
      System.out.println("密文:"+secret);
      System.out.println("输入解密密码");
      Scanner scanner = new Scanner(System.in);
      password = scanner.nextLine();
      String source = person.decrypt(secret,password);
      System.out.println("明文:"+source);
   }
}
